<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>五壮士车库</title>
  <script src="js/jquery-1.8.2.js"></script>
  <link rel="stylesheet" href="layui/css/layui.css" media="all">
</head>
<body class="layui-layout-body">

<div class="layui-layout layui-layout-admin">
<div class="layui-header">
<div class="layui-logo">五壮士车库</div>
<!-- 头部区域（可配合layui已有的水平导航） -->
 <ul class="layui-nav layui-layout-left" lay-filter="">
  
  <li class="layui-nav-item "><a href="lbt.html">首页</a></li>
   <li class="layui-nav-item "><a href="gywm.html">关于我们</a></li>
  <li class="layui-nav-item "><a href="car.html">产品</a></li>
  <li class="layui-nav-item"><a href="xw.html">新闻</a></li>
  <li class="layui-nav-item layui-this"><a href="lxwm.html">联系我们</a></li>
</ul>


 </div>

</div>
<br>
<br>
<br>
<br>
<br>
<div class="layui-container"> 


<div class="layui-row">
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
          <div class="layui-card-header">您的留言</div>
          <div class="layui-card-body" pad15>
            
            <div class="layui-form" wid100 lay-filter="">
              <div class="layui-form-item">
                <label class="layui-form-label">姓名</label>
                <div class="layui-input-block">
                  <input type="text" name="lxwmname"  class="layui-input">
                </div>
              </div>
              <div class="layui-form-item">
                <label class="layui-form-label">电话号码</label>
                <div class="layui-input-block">
                  <input type="text" name="lxwmdhhm"  class="layui-input">
                </div>
              </div>
              <div class="layui-form-item">
                <label class="layui-form-label">邮箱</label>
                <div class="layui-input-block">
                  <input type="text" name="lxwmyx"  class="layui-input">
                </div>
              </div>
              <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">您的建议</label>
                <div class="layui-input-block">
                  <textarea name="lxwmjy" class="layui-textarea" ></textarea>
                </div>
              </div>
              <div class="layui-form-item">
                <div class="layui-input-block">
                  <button class="layui-btn" lay-submit lay-filter="lxwm">发送</button>
                </div>
              </div>
            </div>
            
          </div>
        </div>
      </div>
    </div>
  </div>


</div>
<div class="layui-footer">
    <!-- 底部固定区域 -->
    © layui.com - 底部固定区域
</div>
<!-- 条目中可以是任意内容，如：<img src=""> -->
 
<script src="layui/layui.js"></script>
<script>
//表单提交
layui.use('form', function() {
	var form = layui.form;
	//各种基于事件的操作，下面会有进一步介绍
	form.on('submit(lxwm)', function(data) {//lay-filter="btn"
		console.log(data.elem) //被执行事件的元素DOM对象，一般为button对象
		console.log(data.form) //被执行提交的form对象，一般在存在form标签时才会返回
		console.log(data.field) //当前容器的全部表单字段，名值对形式：{name: value}
		$.ajax({
			url : "/wzsck/lxwmAddServlet",//地址
			type : "get",//请求方式
			data : data.field//参数
			,success : function(res) {//成功以后的回调函数
				if (res == 1) {alert("ok");} 
				else {alert("no");}
			}
		});
		return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
	});
});
</script>

</body>
</html>